//createRouter创建路由函数
//createWebHashHistory创建路由历史记录函数
import {createRouter,createWebHistory,RouteRecordRaw} from 'vue-router'
//RouteRecordRaw声明数组类型
//创建数组  用于指明路由和组件的匹配关系
const routes:Array<RouteRecordRaw>=[
    {
        path:"/",
        component:()=>import('../components/HelloWorld.vue')
    },
    {
        path:"/Demo",
        component:()=>import('../components/Demo.vue')
    },
    {
        path:"/ForDemo",
        component:()=>import('../components/ForDemo.vue')
    },
    {
        path:"/IFDemo",
        component:()=>import('../components/IFDemo.vue')
    },
    {
        path:"/RefDemo",
        component:()=>import('../components/RefDemo.vue')
    },
    {
        path:"/EditStu/:Sid",
        name:"EditStu",//路由命名
        component:()=>import('../components/EditStu.vue')
    }
];

//创建路由
const router =createRouter({
    history:createWebHistory(),
    routes
})

//导出路由
export default router
